package api;

import com.leyou.PageResult;
import item.pojo.Sku;
import item.pojo.Spu;
import item.pojo.SpuBo;
import item.pojo.SpuDetail;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

/**
 * @Author: taft
 * @Date: 2018-11-23 9:39
 */
public interface GoodsApi {
    @GetMapping("spu/page")
    PageResult<SpuBo> querySpuPage(
            @RequestParam(value = "key",required = false) String key,
            @RequestParam(value = "saleable",required = false) Boolean saleable,
            @RequestParam(value = "page", defaultValue = "1") Integer page,
            @RequestParam(value = "rows", defaultValue = "5") Integer rows);


    @GetMapping("sku/list")
    List<Sku> querySkuBySpuId(@RequestParam("id") Long spuId);

    @GetMapping("spu/detail/{spuId}")
    SpuDetail querySpuDetailById(@PathVariable("spuId") Long spuId);

    @GetMapping("spu/{id}")
    Spu querySpuById(@PathVariable("id") Long id);
}
